import util from "@/service/util.js";

const _util = new util();

class portraitmng {
  // 查询任务列表
  selectSubjectFields(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/selectSubjectFields",
    });
  }
  // 添加任务
  insert(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/insert",
    });
  }
  // 删除任务
  delete_dataPortraitsId(param) {
    return _util.request({
      method: "delete",
      url: "/dataPortraits/delete/" + param.dataPortraitsId,
    });
  }
  //   更新任务
  update(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/update",
    });
  }
  //   查询数据管理列表
  selectDataManagements(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/dataManagement/selectDataManagements",
    });
  }
  //   查询数据管理列表
  deletedataManagement(param) {
    return _util.request({
      method: "delete",
      params: param,
      url: "/dataPortraits/dataManagement/delete/" + param.dataId,
    });
  }
  //   查询数据仓库左侧树
  selectWarehouseTree(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/dataManagement/selectWarehouseTree",
    });
  }
  //   查询数据库左侧树
  getOrgInstanceTree(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/appsysdataregapi/v8/extra/getOrgInstanceTree",
    });
  }
  //   查询数据仓库ip下的实例信息
  selectWHIpInfo(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/dataManagement/selectWHIpInfo",
    });
  }
  //   查询数据仓库ip下的实例信息
  selectWHInstanceInfo(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/dataManagement/selectWHInstanceInfo",
    });
  }
  //   查询数据库下的二级右侧表格信息
  listByType(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/appsysdataregapi/v8/extra/config/listByType",
    });
  }

  //   查询数据库下的三级右侧表格信息
  instanceByConfigPage(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/appsysdataregapi/v8/extra/instanceByConfigPage",
    });
  }
  // 数据库查询实例具体信息
  selectByInstanceId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/dataManagement/selectByInstanceId",
    });
  }
  // 批量添加数据管理
  inserts(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/dataManagement/inserts",
    });
  }
  // 根据taskID获取任务
  getByTask(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/task/getByTask",
    });
  }
  // 保存定时任务
  addPlan(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/task/addPlan",
    });
  }
  // 获取标签对象信息
  objectPageByTaskIdKey(param) {
    return _util.request({
      method: "post",
      params: param,
      url: "/dataPortraits/labelObject/objectPageByTaskIdKey",
    });
  }
  // 获取标签信息
  labelPageByTaskIdKey(param) {
    return _util.request({
      method: "post",
      params: param,
      url: "/dataPortraits/label/labelPageByTaskIdKey",
    });
  }
  // 获取字段映射信息
  shineListByTaskIdKey(param) {
    return _util.request({
      method: "post",
      params: param,
      url: "/dataPortraits/label/shineListByTaskIdKey",
    });
  }
  // 更新任务状态
  updateStatus(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/updateStatus",
    });
  }
  // 添加数据管理
  insertdata(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/dataManagement/insert",
    });
  }
  // 删除数据管理
  remove(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/dataManagement/remove",
    });
  }
  // 操作日志
  selectDataLogs(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/selectDataLogs",
    });
  }

  // 数据画像右侧表格
  getPages(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/subTask/getPages",
    });
  }
  // 数据画像右侧表格删除
  deleteById(param) {
    return _util.request({
      method: "delete",
      params: param,
      url: "/dataPortraits/subTask/deleteById",
    });
  }

  // 数据画像右侧表格添加
  datainsert(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/subTask/insert",
    });
  }
  // 数据画像右侧表格修改
  dataupdate(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/subTask/update",
    });
  }

  // 根据任务id获取数据仓库层级
  getStoreLevelOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/label/getStoreLevelOptionsByTaskId",
    });
  }

  // 根据任务id获取数据仓库类型
  getStoreTypeOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/label/getStoreTypeOptionsByTaskId",
    });
  }
  // 根据任务id获取数据仓库地址
  getHierarchyOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/label/getHierarchyOptionsByTaskId",
    });
  }
  // 根据任务id获取数据仓库端口
  getPortOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/label/getPortOptionsByTaskId",
    });
  }
  // 根据任务id获取数据仓库实例
  getStoreInstanceOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/label/getStoreInstanceOptionsByTaskId",
    });
  }
  // 根据任务id获取仓库表选项
  getStoreTableOptionsByTaskId1(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/label/getStoreTableOptionsByTaskId",
    });
  }

  // 回显
  getNodeById(param) {
    return _util.request({
      method: "post",
      params: param,
      url: "/dataPortraits/taskNode/getNodeById",
    });
  }
  // 保存任务节点
  saveTaskNode1(data) {
    return _util.request({
      method: "post",
      data: data,
      url: "/dataPortraits/taskNode/saveTaskNode",
    });
  }

  //任务检测
  taskCheck(param) {
    return _util.request({
      method: "post",
      params: param,
      url: "/dataPortraits/taskNode/taskCheck",
    });
  }

  // 根据任务id获取数据库地址选项
  getDbAddressOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/taskNode/getDbAddressOptionsByTaskId",
    });
  }
  // 根据任务id获取数据库端口选项
  getDbAddressPortOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/taskNode/getDbAddressPortOptionsByTaskId",
    });
  }

  // 根据任务id获取实例选项
  getDbInstanceOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/taskNode/getDbInstanceOptionsByTaskId",
    });
  }

  // 根据任务id获取表格选项
  getDbTableOptionsByTaskId(param) {
    return _util.request({
      method: "get",
      params: param,
      url: "/dataPortraits/taskNode/getDbTableOptionsByTaskId",
    });
  }
}

export default portraitmng;
